package com.sky.controller.admin;

import com.sky.entity.UserReadingData;
import com.sky.result.Result;
import com.sky.service.impl.UserReadingDataServiceImpl;
import io.swagger.annotations.Api;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController("adminUserReadingDataController")
@Api(tags = "管理端-获取用户阅读数据的相关接口")
@Slf4j
@RequestMapping("/admin/user-reading-data")
public class UserReadingDataController {
    @Autowired
    private UserReadingDataServiceImpl userReadingDataService;

    /**
     * 获取用户阅读数据
     * @return
     */
    @GetMapping("/{id}")
    public Result getReadingData(@PathVariable int id) {
        UserReadingData userReadingData = userReadingDataService.getByUId(id);
        return Result.success(userReadingData);
    }
}